package com.education.welco.service.impl;


import com.education.common.utils.Convert;
import com.education.welco.mapper.SCatalogQuestionsMapper;
import com.education.welco.pojo.SCatalogQuestions;
import com.education.welco.service.ISCatalogQuestionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 备课试题关联 服务层实现
 *
 * @author d
 * @date 2020-05-08
 */
@Service
public class SCatalogQuestionsServiceImpl implements ISCatalogQuestionsService {

    @Autowired
    private SCatalogQuestionsMapper sCatalogQuestionsMapper;

    /**
     * 查询备课试题关联信息
     *
     * @param id 备课试题关联ID
     * @return 备课试题关联信息
     */
    @Override
    public SCatalogQuestions selectSCatalogQuestionsById(Integer id) {
        return sCatalogQuestionsMapper.selectSCatalogQuestionsById(id);
    }

    /**
     * 查询备课试题关联列表
     *
     * @param sCatalogQuestions 备课试题关联信息
     * @return 备课试题关联集合
     */
    @Override
    public List<SCatalogQuestions> selectSCatalogQuestionsList(SCatalogQuestions sCatalogQuestions) {
        return sCatalogQuestionsMapper.selectSCatalogQuestionsList(sCatalogQuestions);
    }

    /**
     * 新增备课试题关联
     *
     * @param sCatalogQuestions 备课试题关联信息
     * @return 结果
     */
    @Override
    public int insertSCatalogQuestions(SCatalogQuestions sCatalogQuestions) {
        return sCatalogQuestionsMapper.insertSCatalogQuestions(sCatalogQuestions);
    }

    /**
     * 修改备课试题关联
     *
     * @param sCatalogQuestions 备课试题关联信息
     * @return 结果
     */
    @Override
    public int updateSCatalogQuestions(SCatalogQuestions sCatalogQuestions) {
        return sCatalogQuestionsMapper.updateSCatalogQuestions(sCatalogQuestions);
    }

    /**
     * 删除备课试题关联对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSCatalogQuestionsByIds(String ids) {
        return sCatalogQuestionsMapper.deleteSCatalogQuestionsByIds(Convert.toStrArray(ids));
    }
}